package com.epfresh.bean;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by wzh on 16-8-29.
 */
public class CartList {
    private boolean showCouponFlag;
    private int salesType;
    private String wholeSaleMarketName;

    private List<MarketCart> wholeSaleMarketOrderList;

    private String wallets;
    private double productExpressFee;

    private List<PaymentModes> payTypeList;
    private List<CouponEntity> couponList;
    private List<CouponEntity> couponBestList;
    private List<CouponEntity> couponSelectList;
    private List<DeliveryDate> deliveryDateList;

    private List<DeliveryDateNew> normalDeliveryDate;
    private List<DeliveryDateNew> expressDeliveryDate;

    private int couponRemainQty = 0;//剩余使用优惠券的数量
    private boolean bulkIsUsedCoupon = false;//散货是否使用优惠券；false：不可用；true：可用

    public boolean isShowCouponFlag() {
        return showCouponFlag;
    }

    public void setShowCouponFlag(boolean showCouponFlag) {
        this.showCouponFlag = showCouponFlag;
    }

    public List<DeliveryDate> getDeliveryDateList() {
        return deliveryDateList;
    }

    public List<DeliveryDateNew> getNormalDeliveryDate() {
        return normalDeliveryDate;
    }

    public void setNormalDeliveryDate(List<DeliveryDateNew> normalDeliveryDate) {
        this.normalDeliveryDate = normalDeliveryDate;
    }

    public List<DeliveryDateNew> getExpressDeliveryDate() {
        return expressDeliveryDate;
    }

    public void setExpressDeliveryDate(List<DeliveryDateNew> expressDeliveryDate) {
        this.expressDeliveryDate = expressDeliveryDate;
    }

    public int getCouponRemainQty() {
        return couponRemainQty;
    }

    public void setCouponRemainQty(int couponRemainQty) {
        this.couponRemainQty = couponRemainQty;
    }

    public boolean isBulkIsUsedCoupon() {
        return bulkIsUsedCoupon;
    }

    public void setBulkIsUsedCoupon(boolean bulkIsUsedCoupon) {
        this.bulkIsUsedCoupon = bulkIsUsedCoupon;
    }

    public void setDeliveryDateList(List<DeliveryDate> deliveryDateList) {
        this.deliveryDateList = deliveryDateList;
    }

    public List<MarketCart> getWholeSaleMarketOrderList() {
        return wholeSaleMarketOrderList;
    }

    public void setWholeSaleMarketOrderList(List<MarketCart> wholeSaleMarketOrderList) {
        this.wholeSaleMarketOrderList = wholeSaleMarketOrderList;
    }

    public float getWallets() {
        float f = 0f;
        if (wallets != null && !"null".equals(wallets)) {
            f = Float.valueOf(wallets);
        }
        return f;
    }

    public void setWallets(float wallets) {
        this.wallets = wallets + "";
    }

    public double getProductExpressFee() {
        return productExpressFee;
    }

    public void setProductExpressFee(double productExpressFee) {
        this.productExpressFee = productExpressFee;
    }

    public List<PaymentModes> getPayTypeList() {
        return payTypeList;
    }

    public void setPayTypeList(List<PaymentModes> payTypeList) {
        this.payTypeList = payTypeList;
    }

    public List<CouponEntity> getCouponList() {
        return couponList;
    }

    public void setCouponList(List<CouponEntity> couponList) {
        this.couponList = couponList;
    }
    public void setSelectCouponList(List<CouponEntity> couponList) {
        this.couponSelectList = couponList;
    }

    public List<String> getCoupons() {
        List<String> list = new ArrayList<>();
        if (couponSelectList != null) {
            for (int i = 0; i < couponSelectList.size(); i++) {
                if (couponSelectList.get(i).getSelected()) {
                    list.add(couponSelectList.get(i).getId());
                }
            }
        }
        return list;
    }
    public List<CouponEntity> getSelectCoupons() {
        if (couponSelectList == null || couponSelectList.size() == 0) {
            List<CouponEntity> list = new ArrayList<>();
            if (couponList != null) {
                for (int i = 0; i < couponList.size(); i++) {
                    if (couponList.get(i).getSelected()) {
                        list.add(couponList.get(i));
                    }
                }
            }
            return list;
        }
        return couponSelectList;
    }

    public float getCouponsPrice() {
        float p = 0;
        if (couponList != null) {
            for (int i = 0; i < couponList.size(); i++) {
                if (couponList.get(i).getSelected()) {
                    float minusPriceFloat = couponList.get(i).getMinusPriceFloat();
                    p += minusPriceFloat;
                }
            }
        }
        return ((int) (p * 100)) == 0 ? 0 : -p;
    }

    public List<CouponEntity> getBestCoupons() {
        return couponBestList;
    }

    public void initBestCoupons() {
        if (couponList != null){
            for (int i=0;i<couponList.size();i++){
                if (couponBestList==null){
                    couponBestList = new ArrayList<>();
                }
                couponBestList.add(couponList.get(i));
            }
        }
    }
    public void initSelectCoupons() {
        setSelectCouponList(getSelectCoupons());
    }


    private String wholeSaleMarketId;
    private String storeOrMarketName;
    private String wholeSaleMarketFullName;
    private List<CartGood> productList;
    private List<DeliveryModes> deliveryList;
    private List<Dc> distributionList;
    /////////////private List<DeliveryDate> deliveryDateList;
    private DeliveryDate deliveryDateDef;
    private boolean isDeliverySelect = true;

    private String distributionId;
    private String distributionTitle;
    private String distributionName;

    private String feed;
    //运费起步价
    private float productExpressFeeStartingPrice;

    private boolean overScope;
    private int wholeSalesType;

    private boolean isExpend;

    private Double economizePrice;//折扣扣节省小计
    private String discountStr;//店铺折扣信息


    //原始运费
    private double productExpressFeeOriginal;
    //减免运费
    private double productExpressFeeReduce;
    //////////private double productExpressFee;


    public void setWallets(String wallets) {
        this.wallets = wallets;
    }

    public List<CouponEntity> getCouponBestList() {
        return couponBestList;
    }

    public void setCouponBestList(List<CouponEntity> couponBestList) {
        this.couponBestList = couponBestList;
    }

    public List<CouponEntity> getCouponSelectList() {
        return couponSelectList;
    }

    public void setCouponSelectList(List<CouponEntity> couponSelectList) {
        this.couponSelectList = couponSelectList;
    }

    public String getWholeSaleMarketId() {
        return wholeSaleMarketId;
    }

    public void setWholeSaleMarketId(String wholeSaleMarketId) {
        this.wholeSaleMarketId = wholeSaleMarketId;
    }

    public String getStoreOrMarketName() {
        return storeOrMarketName;
    }

    public void setStoreOrMarketName(String storeOrMarketName) {
        this.storeOrMarketName = storeOrMarketName;
    }

    public String getWholeSaleMarketFullName() {
        return wholeSaleMarketFullName;
    }

    public void setWholeSaleMarketFullName(String wholeSaleMarketFullName) {
        this.wholeSaleMarketFullName = wholeSaleMarketFullName;
    }

    public List<CartGood> getProductList() {
        return productList;
    }

    public void setProductList(List<CartGood> productList) {
        this.productList = productList;
    }

    public List<DeliveryModes> getDeliveryList() {
        return deliveryList;
    }

    public void setDeliveryList(List<DeliveryModes> deliveryList) {
        this.deliveryList = deliveryList;
    }

    public List<Dc> getDistributionList() {
        return distributionList;
    }

    public void setDistributionList(List<Dc> distributionList) {
        this.distributionList = distributionList;
    }

    public DeliveryDate getDeliveryDateDef() {
        return deliveryDateDef;
    }

    public void setDeliveryDateDef(DeliveryDate deliveryDateDef) {
        this.deliveryDateDef = deliveryDateDef;
    }

    public boolean isDeliverySelect() {
        return isDeliverySelect;
    }

    public void setDeliverySelect(boolean deliverySelect) {
        isDeliverySelect = deliverySelect;
    }

    public String getDistributionId() {
        return distributionId;
    }

    public void setDistributionId(String distributionId) {
        this.distributionId = distributionId;
    }

    public String getDistributionTitle() {
        return distributionTitle;
    }

    public void setDistributionTitle(String distributionTitle) {
        this.distributionTitle = distributionTitle;
    }

    public String getDistributionName() {
        return distributionName;
    }

    public void setDistributionName(String distributionName) {
        this.distributionName = distributionName;
    }

    public String getFeed() {
        return feed;
    }

    public void setFeed(String feed) {
        this.feed = feed;
    }

    public float getProductExpressFeeStartingPrice() {
        return productExpressFeeStartingPrice;
    }

    public void setProductExpressFeeStartingPrice(float productExpressFeeStartingPrice) {
        this.productExpressFeeStartingPrice = productExpressFeeStartingPrice;
    }

    public boolean isOverScope() {
        return overScope;
    }

    public void setOverScope(boolean overScope) {
        this.overScope = overScope;
    }

    public int getWholeSalesType() {
        return wholeSalesType;
    }

    public void setWholeSalesType(int wholeSalesType) {
        this.wholeSalesType = wholeSalesType;
    }

    public boolean isExpend() {
        return isExpend;
    }

    public void setExpend(boolean expend) {
        isExpend = expend;
    }

    public Double getEconomizePrice() {
        return economizePrice;
    }

    public void setEconomizePrice(Double economizePrice) {
        this.economizePrice = economizePrice;
    }

    public String getDiscountStr() {
        return discountStr;
    }

    public void setDiscountStr(String discountStr) {
        this.discountStr = discountStr;
    }

    public double getProductExpressFeeOriginal() {
        return productExpressFeeOriginal;
    }

    public void setProductExpressFeeOriginal(double productExpressFeeOriginal) {
        this.productExpressFeeOriginal = productExpressFeeOriginal;
    }

    public double getProductExpressFeeReduce() {
        return productExpressFeeReduce;
    }

    public void setProductExpressFeeReduce(double productExpressFeeReduce) {
        this.productExpressFeeReduce = productExpressFeeReduce;
    }

    public int getSalesType() {
        return salesType;
    }

    public void setSalesType(int salesType) {
        this.salesType = salesType;
    }

    public String getWholeSaleMarketName() {
        return wholeSaleMarketName;
    }

    public void setWholeSaleMarketName(String wholeSaleMarketName) {
        this.wholeSaleMarketName = wholeSaleMarketName;
    }
}
